package pattern.proxy;

public class TestProx {
    public  static void main(String[]args)
    {
        //static proxy
        BusinessImpl business=new BusinessImpl();
        BusinessProx businessProx=new BusinessProx(business);
        businessProx.execute();

        //dynamic proxy
        IBusiness business2=new BusinessImpl();
        ProxyFactory proxFactory= new ProxyFactory(business2);
        IBusiness businessProxy2=(IBusiness) proxFactory.getProxyInstance();
        businessProxy2.execute();
    }
}
